package com.seu.me.activemq.mq.consumer.topic;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;


/**
 * Topic消息监听器
 *
 * @author liangfeihu
 */
@Slf4j
@Component
public class TopicReceiver1 implements MessageListener {

    @Override
    public void onMessage(Message message) {
        try {
            log.info("TopicReceiver1接收到消息:{}", ((TextMessage) message).getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }

}
